home *** CD-ROM | disk | FTP | other *** search
/ Painter Bear's Language Bridge — Italian / Bridge_ponte_itialian.iso / pc / helpers / open.dxr / 00020_RACE FRAME SCRIPT.ls < prev    next >
Encoding:
Text File  |  2001-02-22  |  3.1 KB  |  124 lines

  1. on exitFrame
  2.   global gCurrSndList, gRaceTimer, gRacing, gFlashTimer, gNxtTime, gRampTime, gRaceLength
  3.   if (gCurrSndList <> []) and not soundBusy(1) then
  4.     advanceSndList()
  5.   end if
  6.   if the isStarted of gRaceTimer = 1 then
  7.     reportTimer(gRaceTimer)
  8.     set theRaceTime to the myTime of gRaceTimer
  9.     if gRacing = 0 then
  10.       nothing()
  11.     else
  12.       if gRacing = 1 then
  13.         if theRaceTime >= (60 * 1) then
  14.           goToPhaseTwo()
  15.         end if
  16.       else
  17.         if gRacing = 2 then
  18.           if theRaceTime >= (60 * 1) then
  19.             goToPhaseThree()
  20.           end if
  21.         else
  22.           if gRacing = 3 then
  23.             if theRaceTime >= (60 * gRaceLength) then
  24.               goToPhaseFour()
  25.             else
  26.               raceObstacles()
  27.             end if
  28.           else
  29.             if gRacing = 4 then
  30.               raceObstacles()
  31.               reportTimer(gFlashTimer)
  32.               if the myTime of gFlashTimer >= (60 * 1) then
  33.                 flashRaceSign()
  34.               end if
  35.             else
  36.               if gRacing = 5 then
  37.                 reportTimer(gFlashTimer)
  38.                 if the myTime of gFlashTimer >= (60 * 1) then
  39.                   flashRaceSign()
  40.                 end if
  41.               else
  42.                 if gRacing = 8 then
  43.                   if theRaceTime >= (60 * gRaceLength) then
  44.                     goToPhaseFour()
  45.                   else
  46.                     reportTimer(gFlashTimer)
  47.                     if the myTime of gFlashTimer >= (gRampTime * 3) then
  48.                       stopRampHappiness()
  49.                     else
  50.                       pursueRampHappiness()
  51.                       raceObstacles()
  52.                     end if
  53.                   end if
  54.                 else
  55.                   if gRacing = 9 then
  56.                     if theRaceTime >= (60 * gRaceLength) then
  57.                       goToPhaseFour()
  58.                     else
  59.                       reportTimer(gFlashTimer)
  60.                       if the myTime of gFlashTimer >= 30 then
  61.                         stopCollisionPunishment()
  62.                       else
  63.                         raceObstacles()
  64.                       end if
  65.                     end if
  66.                   end if
  67.                 end if
  68.               end if
  69.             end if
  70.           end if
  71.         end if
  72.       end if
  73.     end if
  74.   end if
  75.   if (gRacing = 8) or (gRacing = 9) or (gRacing = 3) then
  76.     if theRaceTime >= gNxtTime then
  77.       rollDownClock()
  78.     end if
  79.   end if
  80.   go(the frame)
  81. end
  82.  
  83. on keyDown
  84.   global gRacing
  85.   if the keyCode = 123 then
  86.     moveCar("2")
  87.   else
  88.     if the keyCode = 124 then
  89.       moveCar("1")
  90.     else
  91.       if the keyCode = 125 then
  92.         doSpeed("1")
  93.       else
  94.         if the keyCode = 126 then
  95.           doSpeed("2")
  96.         end if
  97.       end if
  98.     end if
  99.   end if
  100. end
  101.  
  102. on keyUp
  103.   global gRacing, gPopped
  104.   if the keyCode = 123 then
  105.     moveCar("2")
  106.   else
  107.     if the keyCode = 124 then
  108.       moveCar("1")
  109.     else
  110.       if the keyCode = 125 then
  111.         doSpeed("1")
  112.       else
  113.         if the keyCode = 126 then
  114.           doSpeed("2")
  115.         end if
  116.       end if
  117.     end if
  118.   end if
  119.   if (the key = RETURN) and (gPopped = 1) then
  120.     disappearPop()
  121.     prepRAce()
  122.   end if
  123. end
  124.